
   export const  setCookie=(cname:string,cvalue:string,exdays:number)=> {
        let date = new Date();
        date.setTime(date.getTime()+(exdays*24*60*60*1000));
        let expires = "expires="+date.toUTCString();
        document.cookie = cname + "=" + cvalue + "; " + expires;
    }
   export const  getCookie=(cname:string)=> {
        let name = cname + "=";
        let ca = document.cookie.split(';');
        for(let i=0; i<ca.length; i++)
        {
            let c = ca[i].trim();
            if (c.indexOf(name)===0) return c.substring(name.length,c.length);
        }
        return "";
    }
    export const deleteCookie=(cname:string)=>{
        document.cookie = `${cname}=; expires=Thu, 01 Jan 1970 00:00:00 GMT`;

    }


